/**
 * Project: push-center-biz-dal
 * 
 * File Created at 2014年10月9日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.push.dal.pushcenter.impl;

import java.util.List;

import com.greenline.push.dal.base.BaseDAO;
import com.greenline.push.dal.pushcenter.TaskSyncDAO;
import com.greenline.push.dal.pushcenter.dataobject.TaskSyncDO;
import com.greenline.push.dal.query.TaskSyncQuery;

/**
 * @Type AppChannelDAOImpl
 * @Desc
 * @author zhaoli
 * @date 2014年10月9日
 * @Version V1.0
 */
public class TaskSyncDAOImpl extends BaseDAO implements TaskSyncDAO {

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.dal.pushcenter.AppChannelDAO#insert(com.greenline.
     * push.dal.pushcenter.dataobject.AppChannelDO)
     */
    @Override
    public Long insert(TaskSyncDO taskSyncDo) {
        return (Long) super.getSqlMapClientTemplate().insert("taskSync.insert", taskSyncDo);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.dal.pushcenter.AppChannelDAO#getAppChannelById(java
     * .lang.Long)
     */
    @Override
    public TaskSyncDO getById(Long id) {
        return (TaskSyncDO) super.getSqlMapClientTemplate().queryForObject("taskSync.find_by_id", id);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.dal.pushcenter.AppChannelDAO#update(com.greenline.
     * push.dal.pushcenter.dataobject.AppChannelDO)
     */
    @Override
    public int update(TaskSyncDO taskSyncDO) {
        return super.getSqlMapClientTemplate().update("taskSync.update", taskSyncDO);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.dal.pushcenter.AppChannelDAO#listByQuery(com.greenline
     * .push.dal.query.AppChannelQuery)
     */
    @Override
    public TaskSyncQuery listByQuery(TaskSyncQuery query) {
        return (TaskSyncQuery) super.listByQuery("taskSync.list_by_query", query);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.dal.pushcenter.AppChannelDAO#delete(java.lang.Long)
     */
    @Override
    public int delete(Long id) {
        return super.getSqlMapClientTemplate().delete("taskSync.delete", id);
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<TaskSyncDO> listByExample(TaskSyncDO taskSyncDO) {
        return getSqlMapClientTemplate().queryForList("taskSync.find_by_example", taskSyncDO);
    }

    @Override
    public TaskSyncDO getTaskSyncByType(int type) {
        return (TaskSyncDO) super.getSqlMapClientTemplate().queryForObject("taskSync.find_by_type", type);
    }

}
